/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.schedule.manage.util;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleNodeCreateOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleNodeDeleteOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleNodeEditOrder;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageAddForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageDeleteForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageEditForm;

/**
 * <b>(ScheduleNodeManageConvertor)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/7
 */
public class ScheduleNodeManageConvertor {

    public static ScheduleNodeCreateOrder convertOrder(ScheduleNodeManageAddForm form) {
        return BeanUtil.toBean(form, ScheduleNodeCreateOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static ScheduleNodeEditOrder convertOrder(ScheduleNodeManageEditForm form) {
        return BeanUtil.toBean(form, ScheduleNodeEditOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static ScheduleNodeDeleteOrder convertOrder(ScheduleNodeManageDeleteForm form) {
        return BeanUtil.toBean(form, ScheduleNodeDeleteOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }
}